<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
          
      xmlns:p="http://primefaces.org/ui">
    <ui:composition template="structpage/templates/defaultLayout.xhtml">
            <ui:define name="title">
                    <h:outputText value="ChequeTeatinos" />
        </ui:define>
        <ui:define name="content">
            <h2> Login </h2>
            <h:panelGroup layout="block">
                <h:form>
                    <h:panelGroup layout="block" class="form_settings">
                        
                        <p>
                            <span>
                                <p:outputLabel value="#{msg.email} " />
                            </span>
                            <p:inputText id="emailTextField" value="#{loginBean.email}" required="true" label="E-Mail" validatorMessage="Formato de e-mail incorrecto.">
                                <f:ajax event="blur" render="EmailValidationMessage" />  
                            </p:inputText>
                        </p>
                        <p>
                            <span>
                                <p:outputLabel value="#{msg.password} "/>
                            </span>
                            <p:password id="passwordTextField" value="#{loginBean.password}" required="true" label="Password">
                                <f:ajax event="blur" render="PasswordValidation" />  
                            </p:password>
                        </p>
                            
                        <h:commandButton id="doLogin" value="#{msg.login}" action="#{loginBean.doLogin()}" styleClass="submit"/>
                    </h:panelGroup>
                    <p>
                        <span><h:message for="emailTextField" styleClass="error" id="EmailValidationMessage"/><br/></span>
                    </p>
                    <p>
                        <span><h:message for="passwordTextField" styleClass="error" id="PasswordValidation"/><br/></span>
                    </p>
                    <p>
                        <span><h:outputLabel value="#{loginBean.error}" styleClass="error"/><br/></span>
                    </p>
                </h:form>
            </h:panelGroup>
        </ui:define>
    </ui:composition>
</html>